import { invoke } from "@tauri-apps/api/core";


// 加载用户组件 
export async function load_xcom_service_dxc() {
  const ret = await invoke("load_dxc", {
    loadInfo: {
      name: "XComService",
      version: "0.0.1",
      config: 'system = true\nmode = \"single\"',
      compatible_versions: [],
    },
  });
  console.log(ret);
}

// // 加载用户组件 
// export async function load_http_service_dxc() {
//   const ret = await invoke("load_dxc", {
//     loadInfo: {
//       name: "HttpService",
//       version: "0.0.1",
//       config: 'ip = \"127.0.0.1\"\nport = 8091\nsystem = true',
//       compatible_versions: [],
//     },
//   });
//   console.log(ret);
// }


// 加载用户组件 
export async function load_user_dxc() {
  const ret = await invoke("load_dxc", {
    loadInfo: {
      name: "UserService",
      version: "0.0.1",
      config: '',
      compatible_versions: [],
    },
  });
  console.log(ret);
}


// 加载用户组件 
export async function load_rtdata_subscriber_service_dxc() {
  const ret = await invoke("load_dxc", {
    loadInfo: {
      name: "RtdataSubscriberService",
      version: "0.0.1",
      config: 'data-path=\"./\"',
      compatible_versions: [],
    },
  });
  console.log(ret);
}


